// pagesb/detailed/detailed.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    current:0,
    vertical: false,
    autoplay: true,
    interval: 3000,
    duration: 1000,
    circular:true,
    goodsTypeShowFlag:false,
    active1:0,
    num:0,
    bannerlist:[{pic:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fattach.bbs.miui.com%2Fforum%2F201408%2F07%2F194920riib8aubcmzoarli.jpg&refer=http%3A%2F%2Fattach.bbs.miui.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1633419324&t=1a71ecc0ea869a274e9a3e7b0b505e57'},{pic:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2F01.minipic.eastday.com%2F20170224%2F20170224133956_9b9688ef44943a76c1abcfbc19d3182d_8.jpeg&refer=http%3A%2F%2F01.minipic.eastday.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1633419339&t=93d9179565d9dffada2fdb1efd329d3c'},{pic:'https://img0.baidu.com/it/u=1993128450,1251245082&fm=26&fmt=auto&gp=0.jpg'}]
  },
  currentHandle(e){
    this.setData({ current:e.detail.current})
  },
  closeGoodsType() {
    this.setData({
      goodsTypeShowFlag: false
    })
  },
  openmask(){
    this.setData({
      goodsTypeShowFlag:true
    })
  },
  changskuid(e){
    this.setData({
      num:1,
      active1:e.currentTarget.dataset.item
    })
  },add(){
    this.setData({
      num:this.data.num + 1
    })
  },
  sub(){
    if(this.data.num==1){
      return;
    }
    this.setData({
      num:this.data.num - 1
    })
  },
  // 规格确认
  confirmBtnClick(){
    this.setData({
      goodsTypeShowFlag:false
    })
    wx:wx.navigateTo({
      url: '/pagesb/confirmorder/confirmorder?num='+this.data.num,
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log(options.id)
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})